<?php
header('Content-Type:text/html;charset=UTF-8');

session_start();

if(isset($_SESSION['userId'])){

}else {
	die('<h3>登录信息不完整</h3><a href="/index.php">返回重新登录</a>');
};

@$id = $_SESSION['userId'];

require 'lib/db.php';

@$users = dbSelect("select u.id as uid,login,password,roleId,r.name as rname,w.id as wid,w.name as wname,age,sex,contact,address,img from users as u join role as r on u.roleId=r.id join worker as w on u.id=w.id");

if ($id==1){
	$users['rname']='总裁';
}

if ($id==2&&$id==3){
	$users['rname']='主管';
}

if ($id==4&&$id==5&&$id==6&&$id==7){
	$users['rname']='销售代表';
}
if ($id==8){
	$users['rname']='系统维护';
}

var_dump($users);


?>

<!DOCTYPE html>
<html>
   <head>
      <title>CRM客户关系管理系统</title>
	  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" charset="UTF-8" >
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
      <link href="bootstrap/css/bootstrap-submenu.css" rel="stylesheet">
      <link href="bootstrap/css/superfish.css" rel="stylesheet">
      <link href="bootstrap/css/superfish-vertical.css" rel="stylesheet">
      <script src="bootstrap/js/jquery-1.11.1.min.js"></script>
      <script src="bootstrap/js/bootstrap.min.js"></script>
      <script src="bootstrap/js/bootstrap-submenu.js"></script>
      <script src="bootstrap/js/superfish.js"></script>
      <!--[if lt IE 9]>
         <script src="js/html5shiv.js"></script>
         <script src="js/respond.min.js"></script>
      <![endif]-->
   </head>
  <script src="lib/menu.js"></script>
   <script src="lib/red.js"></script>
    <script src="lib/dialog.js"></script>
<script>
$(function(){
		$('.menus').menu();

		$.ajaxSetup({
			dataType:'JSON',
			error:function(){
				alert('服务器交互出错！');
				}
			});
		$('#logoutBtn').click(function(){
			confirmDialog('提示','确定退出？');
			$('#confirm').click(function(){
				});
			});
			
	});
</script>
<style>
	#confirm{color:red}
	.header{background:#681709}
	.modaltitle{color:white;font-size:20px}
	.navbar{background:#681709;}
	.marginal{height:10px;background:red}
	.title{font-size:30px;text-align:cneter;background:}
	#span{color:#e8e8e8;}
	#c{color:#ff8d1c;}
	#R{color:#ffff1e;}
	#M{color:#00ff00;}
	#logoutBtn{font-size:18px;color:red}
	.font{margin:0px;height:59px;text-align:center;width:270px;background:#681709}
	#user{border:solid 1px;width:240px;height:32px;text-align:left;background:black;color:white}
	#users{width:80px;float:left;border:solid 1px;background:black;color:white}
	.main{border:solid 1px;height:}
	#marginal{height:490px;width:15px;background:#681709;border-radius:10px;float:left}
	.menus a{display:block;width:200px;font-size:25px;}
    .menu{display:none;text-align:center}
    #a{font-size:16px;color:white;background:#681709}
    .titles{border:solid 3px;width:210px;border-radius:15px;}
	#FirstBtn{font-size:18px;color:red}
 </style>
  <body>
  	<nav class="navbar navbar-default">
 			<div class="row navbar-form">
 				<div class="col-xs-3 title">
 					<span id="c">C</span><span id="R">R</span><span id="M">M</span><span id="span">客户关系管理系统</span>
 				</div>
 				<div class="col-xs-6 text-right fonts">
 					
 				</div>
 				<div class="col-xs-3 text-right font">
 					<div id="user">
 					<img src="img/<?php echo $users['img']; ?>" style="width: 20px;height: 20px">
 					在线用户：<?php echo $users['wname']; ?>--<<?php echo $users['rname']; ?>>
 					</div>
 					<div id="users">
 					<a href="First.php" id="FirstBtn">首　页</a>
 					</div>
 					<div id="users">
 					<a href="#" id="logoutBtn" data-toggle="modal">退出系统</a>
 					</div>
 					<div id="users">
 					<a href="#" id="FirstBtn" data-toggle="modal">帮　助</a>
 					</div>
 				</div>
 				
 			</div>
 		</nav>
 	
 	<div class="container">
	 	<div class="row">
		 		<div class="col-xs-12">
	 			<div  id="marginal"></div>
	 			<div class="col-xs-3 titles">
	 				<ul class="sf-menu sf-vertical">
						<li class="current">
							<a href="#" id="a">用户登陆管理</a>
							<ul>
								<li><a href="Alteruse.php" id="a">个人资料信息</a></li>
								<li><a href="Alterinfo.php" id="a">个人信息修改</a></li>
							</ul>
						</li>
						<li><a href="#" id="a">我的客户管理</a>
							<ul>
							<li><a href="success.php"id="a">成功客户列表</a></li>
				   			<li><a href="seekIn.php"id="a">挑入记录列表</a></li>
				   			<li><a href="seekOut.php"id="a">挑出记录列表</a></li>
				   			<li><a href="myClient.php"id="a">我的客户列表</a></li>
				   			<li><a href="publicClient.php"id="a">公共客户列表</a></li>
							</ul>
						</li>
						<li><a href="#" id="a">业务产品管理</a>
							<ul>
								<li><a href="companyProduct.php"id="a">公司产品</a></li>
				   				<li><a href="myTrade.php"id="a">我的交易</a></li>
				   			</ul>
				   		</li>
						<li><a href="#" id="a">全部客户管理</a>
							<ul>
								<li><a href="allClient.php"id="a">全部客户列表</a></li>
				   			</ul>
						</li>
						<li><a href="#" id="a">全体职员管理</a>
							<ul>
								<li><a href="allphpWorker.php"id="a">全体职员列表</a></li>
				   			</ul>
						</li>
						<li><a href="#" id="a">销售客户统计</a>
							<ul>
								<li><a href="#"id="a">全体销售代表成绩表</a></li>
				   			</ul>
						</li>
						<li><a href="#" id="a">销售部门管理</a>
							<ul>
								<li><a href="sell.php"id="a">销售部列表</a></li>
				   			</ul>
						</li>
						<li><a href="#" id="a">系统用户管理</a>
							<ul>
								<li><a href="systemUse.php"id="a">系统用户列表</a></li>
				   			</ul>
						</li>
						<li><a href="#" id="a">角色权限管理</a>
							<ul>
								<li><a href="systemUseRole.php"id="a">系统用户角色列表</a></li>
				   			</ul>
						</li>
						<li><a href="#" id="a">客户跟进管理</a>
							<ul>
								<li><a href="#"id="a">待跟进客户列表</a></li>
				   				<li><a href="myTabb.php"id="a">我的客户跟进列表</a></li>
				   			</ul>
						</li>
					</ul>
	 			</div>
	 			<div class="col-xs-8 main">
	 				
	 			</div>
	 		</div>
	 	</div>
 	</div>
 </body>
  <script>
   	$('.dropdown-submenu > a').submenupicker();
   	$('.sf-menu').superfish();
   </script>
</html>









